/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 */
using VOL.Core.BaseProvider;
using VOL.Entity.DomainModels;
using VOL.Core.Utilities;

namespace VOL.demo.IServices
{
    public partial interface IGoodsBatchModelService : IService<GoodsBatchModel>
    {
        /// <summary>
        /// 根据货品ID和仓库ID获取批次信息
        /// </summary>
        /// <param name="goodsId">货品ID</param>
        /// <param name="warehouseId">仓库ID</param>
        /// <returns></returns>
        List<GoodsBatchModel> GetBatchesByGoodsAndWarehouse(long goodsId, long warehouseId);

        /// <summary>
        /// 批量保存批次信息
        /// </summary>
        /// <param name="batches">批次列表</param>
        /// <returns></returns>
        WebResponseContent SaveBatches(List<GoodsBatchModel> batches);

        /// <summary>
        /// 计算期初库存总量
        /// </summary>
        /// <param name="batches">批次列表</param>
        /// <returns></returns>
        int CalculateTotalQuantity(List<GoodsBatchModel> batches);

        /// <summary>
        /// 获取货品批次与库存联查列表（分页）
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="goodsId">货品ID（可选）</param>
        /// <param name="warehouseId">仓库ID（可选）</param>
        /// <param name="batchNo">批次号（可选）</param>
        /// <param name="keyword">搜索关键词（可选）</param>
        /// <returns></returns>
        Task<(List<GoodsBatchInventoryDto> Data, int TotalCount)> GetBatchInventoryPagedListAsync(
            int pageIndex = 1, 
            int pageSize = 20, 
            long? goodsId = null, 
            long? warehouseId = null, 
            string batchNo = null, 
            string keyword = null);
    }
}
